package com.ecar.api.service.manager.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ecar.api.service.manager.LogLoginService;
import com.ecar.common.dto.DataBean;
import com.ecar.common.dto.DataBeanEcar;
import com.ecar.common.dto.Pager;
import com.ecar.core.manager.dao.LogLoginMapper;
import com.ecar.core.manager.entity.LogLogin;

@Service
@Transactional
public class LogLoginServiceImpl  implements LogLoginService {
	@Autowired
	LogLoginMapper logLoginMapper;

	@Override
	public DataBeanEcar getByPager(Pager pager) {
		 List<HashMap<String, Object>> list = logLoginMapper.selectByPager(pager);
		  int totalNum = Integer.parseInt(list.get(0).get("number").toString());
		return new DataBeanEcar(200, list, "调用返回成功", totalNum, totalNum/pager.getPageSize());
		
	}



}
